module.exports = function($scope, $state, $stateParams,$resource,toaster, $http, $q, pcode ,$modalInstance){ 
  var pcode = pcode
  $scope.info = {};
    
    $resource('/api/as/ggc/tourgroupafter/getTGPeoplebyCode', {}, {}).save({'people_code':pcode},function (res) {
      if (res.errcode !== 0) {
        alert("数据获取失败");
        return;
      }
      $scope.obj = res.data;
    });


$scope.gogo =function() {
  $scope.obj.people_code = pcode;
  $resource('/api/as/ggc/tourgroupafter/updateTGPeople', {}, {}).save($scope.obj,function (res) {
    if (res.errcode !== 0) {
      alert("创建失败");
      return;
    }else{
      toaster.success({ title: "提示", body: "修改成功!"});
      $modalInstance.close();
    }
  });
};


$scope.cancel = function(){

  $modalInstance.close();

}

};